package design.simdi.code.final_paper.core.entities;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * 
 * @author Marius Dumitriu - (Jun 2, 2010 - 11:27:40 AM)
 *
 */
@Entity
@Table(name = "userroles")
@AttributeOverrides( { @AttributeOverride(name = "id", column = @Column(name = "UserRole_Id")) })
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class UserRole extends ApplicationEntity {

	private static final long serialVersionUID = 1L;

	private Role role; 
	private User user;
	/**
	 * @return the group
	 */
	@ManyToOne
	@JoinColumn(name = "Role_Fk")
	public Role getRole() {
		return role;
	}
	/**
	 * @param group the group to set
	 */
	public void setRole(Role role) {
		this.role = role;
	}
	/**
	 * @return the user
	 */
	@ManyToOne
	@JoinColumn(name = "User_Fk")
	public User getUser() {
		return user;
	}
	/**
	 * @param user the user to set
	 */
	public void setUser(User user) {
		this.user = user;
	} 
	
}
